<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
	prefix="tiles"%>

<rich:panel header="#{messages['booking.label']}">
	<h:panelGrid>
		<h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText>
	</h:panelGrid>
	
	<h:panelGrid width="100%">
	    <h:outputText value="#{messages['rci.booking.label']}" styleClass="sub_header" />
	</h:panelGrid>
	
	<h:panelGrid columns="4">
		<h:outputLabel for="searchBy" value="#{messages['search.by.label']}" styleClass="standardText_Label" />
		<t:selectOneMenu id="searchBy" styleClass="standardText" value="#{adminRCIBookingBean.searchField}" required="true">
				<f:selectItems value="#{adminRCIBookingBean.selectSearchList}"/>
		</t:selectOneMenu>
		<t:inputText size="20" maxlength="20" styleClass="standardText" value="#{adminRCIBookingBean.searchKeyword}"></t:inputText>
		<h:commandButton value="#{messages['search']}" action="#{adminRCIBookingBean.searchRCIBookingAction}" 
					actionListener="#{adminRCIBookingBean.searchRCIBookingActionEvent}" styleClass="button">
		</h:commandButton>
	</h:panelGrid>
	
	<h:panelGrid width="100%" columns="1">
	    <h:panelGroup>
			<rich:dataTable id="data" var="rciBooking" value="#{adminRCIBookingBean.rciBookingList}" rows="20" width="99%">
				<rich:column style="text-align:center;width:30%;">
					<f:facet name="header">
						<h:outputText value="#{messages['rci.booking.no.column']}"></h:outputText>
					</f:facet>
				
					<h:commandLink action="#{adminRCIBookingBean.navEditRCIBookingAction}" actionListener="#{adminRCIBookingBean.navEditRCIBookingActionEvent}">
						<h:outputText value="#{rciBooking.rciBookingNo}"></h:outputText>
					</h:commandLink>
					<f:param id="rciBookingId" value="#{rciBooking.rciBookingId}" />
				</rich:column>
				
				<rich:column style="text-align:center;width:30%;">
					<f:facet name="header">
						<h:outputText value="#{messages['rci.booking.date.column']}"></h:outputText>
					</f:facet>
					<h:outputText value="#{rciBooking.rciBookingDate}">
						<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Asia/Kuala_Lumpur"/>
					</h:outputText>
				</rich:column>
				
				<rich:column style="text-align:center;width:30%;">
					<f:facet name="header">
						<h:outputText value="#{messages['rci.booking.status.column']}"></h:outputText>
					</f:facet>
				    <h:outputText value="#{rciBooking.status}"></h:outputText>
				</rich:column>	
			</rich:dataTable>
		</h:panelGroup>
		
		<rich:datascroller align="left"  for="data" maxPages="20" />
		
		<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
			<h:outputText></h:outputText>
			<h:commandButton value="#{messages['new.rci.booking.button']}" action="#{adminRCIBookingBean.navAddRCIBookingAction}" 
					actionListener="#{adminRCIBookingBean.navAddRCIBookingActionEvent}" styleClass="button">
			</h:commandButton>
		</t:panelGrid>
	</h:panelGrid>
	
</rich:panel>	